//
//  HTPieChartViewController.m
//  HTDemo
//
//  Created by meet on 14-3-14.
//  Copyright (c) 2014年 HT. All rights reserved.
//

#import "HTPieChartViewController.h"
#import "HTPieChart.h"

static CGFloat const kMargin = 20;
static CGFloat const kFinishProportion = 0.3;
@interface HTPieChartViewController ()<HTPieChartDataSource>

@end

@implementation HTPieChartViewController

#pragma mark - 生命周期
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.navigationItem.title = @"饼状图";
    self.view.backgroundColor = [UIColor whiteColor];
    [self drawPieChart];
}
#pragma mark - 绘制视图
- (void)drawPieChart
{
    CGFloat pieRadius = Screen_Width - 2*kMargin;
    HTPieChart *pieChart = [[HTPieChart alloc] initWithFrame:CGRectMake(0, 0, pieRadius, pieRadius)];
    pieChart.center = CGPointMake(Screen_Width/2, Screen_Height/2);
    pieChart.dataSource = self;
    [self.view addSubview:pieChart];
    
}

#pragma mark - pieChart DataSource
- (CGFloat)theFinishProportionInPieChart:(HTPieChart *)pieChart
{
    return kFinishProportion;
}

//- (UIColor *)theFinishProportionColorInPieChart:(HTPieChart *)pieChart
//{
//    return [UIColor blackColor];
//}
//
//- (UIColor *)theUnfinishProportionColorInPieChart:(HTPieChart *)pieChart
//{
//    return [UIColor blueColor];
//}

@end
